package com.game.center.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Configuration
@ConfigurationProperties(prefix = "game.common.config")
public class GameCenterConfig {

    private int serviceId = 3;
    /*** 服务器ID，在整个集群之中，相同的serviceId下的serverId必须唯一。*/
    private int localServerId = 3001;
    private int userTokenExpire = 30;
    private int playerTokenExpire = 30;

    public int getUserTokenExpire() {
        return userTokenExpire;
    }

    public void setUserTokenExpire(int userTokenExpire) {
        this.userTokenExpire = userTokenExpire;
    }

    public int getPlayerTokenExpire() {
        return playerTokenExpire;
    }

    public void setPlayerTokenExpire(int playerTokenExpire) {
        this.playerTokenExpire = playerTokenExpire;
    }

    public int getLocalServerId() {
        return localServerId;
    }

    public void setLocalServerId(int localServerId) {
        this.localServerId = localServerId;
    }

    public int getServiceId() {
        return serviceId;
    }

    public void setServiceId(int serviceId) {
        this.serviceId = serviceId;
    }


    @PostConstruct
    public void init() {
        System.out.println("GameCenter初始化");
    }
}
